package utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class FileUtils {
    public static String readFileToString(String file) throws IOException {
        File f = new File(file);
        if (!f.exists()) {
            throw new IOException("file not found");
        }

        FileInputStream fileInputStream = new FileInputStream(f);
        byte[] buffer = new byte[100000];
        int count = fileInputStream.read(buffer);

        return new String(buffer, 0, count);
    }

    public static boolean isFileExists(String file) {
        File f = new File(file);
        return f.exists();
    }
}
